__file__ = 'A04.py'
__author__ = 'Jerry Liu'
__date__ = '2016-04-13'

"""
    问题：任一个英文的纯文本文件，统计其中的单词出现的个数。
"""

import  re

def count(path):
    f = open(path, 'r')
    s = f.read()
    wcount = re.findall('[\S\w+\b]+', s)
    print(len(wcount))

if __name__ == '__main__':
    count('d:\\test.txt')
